MAX_SPD = 95
MIN_SPD = 90

music_table1 = \
(
    (str({'SPEED':50}), ),
    # 1
    ("6:3+,1+:3+,1+=1/8", "3+,1+:2+,7:3+,1+:6+,3+=1/16", "5+,7:3+,6=1/8", "5+,7=1/4"),
    ("6=:1+=1/8", "1+:6=1/16", "1+:2+=1/8", "3+,1+=3/8", "2+:1+=1/32", "7:5:2:3=1/16"),
    ("6-:3,1:3,1=1/8", "3,1:2,7-:3,1:6,3=1/16", "5,7-:3,6-=1/8", "5,7-=1/4"),

    # 4
    ("6:3=1/32", "6-=3/32", "5-:6-=1/16", "1:5:6:1+=1/16", ("5+:1+=1/32", "6=7/32", "0=1/8", "6+:7+=1/16")),


)

MAX_SPD_L = 90
MIN_SPD_L = 70

music_table2 = \
(
    (str({'SPEED':60}), ),
    ("0=1",),

    # 1
    ("0=3/4",),
    ("6--:3-:7-:3,1:3-=1/8", "7-=1/2"),
    ("0=1/4", "5--=1/8"),
    ("4--:1-:5-=1/8", "3,1=3/8"),

    #5
    ("6-=3/8", "0=1/4", "3--=1/8"),
    ("2--:6--:4-=1/8", "4,1=1/8", "0=1/4"),
    ("3--:7--:5-=1/8", "0=3/8"),
    ("4--:1-:5-:6-:1:0=1/8",),

    #9
    ("0=3/8", str({'SPEED':100}), "3-,7--=1/4", str({'SPEED':0}),"3-,7--,3--=1/8"),
    (str({'SPEED':100}), "6--,6---=1/8",str({'SPEED':100}), "3-:7-:3,1:3-=1/8", str({'SPEED':0}), "6--,6---=1/8", ),
    ("6--,6---=1/8", str({'SPEED':MIN_SPD_L}), "3-:7-:3,1:3-=1/8", str({'SPEED':MIN_SPD_L}),"5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8",str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #13
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "3--,3---=1/8",),
    ("2--,2---=1/8", str({'SPEED':MIN_SPD_L}), "6--:4-:4,1:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),
    ("3--,3---=1/8", str({'SPEED':MIN_SPD_L}), "7--:5-:2,7-:5-=1/8", str({'SPEED':MAX_SPD_L}),"5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:5-:6-:1=1/8", str({'SPEED':MAX_SPD_L}),"4--,4---=1/8",),

    #17
    (str({'SPEED':MIN_SPD_L}),"4--,4---=1/2", "0=1/4"),
    ("6--:3-:6-:1:6-:3-=1/8",),
    ("6--:3-:6-:1:6-:3-=1/8",),
    ("2--:2-:4-:6-:4-:2-=1/8",),

    #21
    ("2--:2-:4-:6-:4-:2-=1/8",),
    ("1--:3-:5-:1:5-:3-=1/8",),
    ("5--:3-:5-:1:5-:3-=1/8",),
    ("3--:7--:3-:5-:3-:7--,3--=1/8",),

    #25
    ("3--:0:2-:3-:5-:3--=1/8",),
    ("6---:3-:6-:1:6-:3-=1/8",),
    ("6---:3-:6-:1:6-:3-=1/8",),
    ("2--:2-:4-:6-:4-:2-=1/8",),

    #29
    ("2--:2-:4-:6-:4-:2-=1/8",),
    ("1--:3-:5-:1:5-:3-=1/8",),
    ("5--:3-:5-:1:5-:3-=1/8",),
    ("3--:7--:3-:5-:3-:7--,3--=1/8",),

    #33
    ("3--,3---=1/4", "0=1/8", str({'SPEED':MAX_SPD_L}), "3-,7--=1/4", str({'SPEED':MIN_SPD_L}), "3-,7--,3--=1/8"),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--=1/8",),
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #37
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "3--,3---=1/8",),
    ("2--,2---=1/8", str({'SPEED':MIN_SPD_L}), "6--:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),
    ("3--,3---=1/8", str({'SPEED':MIN_SPD_L}), "7--:5-:2,7-:5-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("6--,6---=1/8", str({'SPEED':MIN_SPD_L}), "3-:7-:3,1:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),

    #41
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "3-=1/8",),
    ("6--,6---=1/8", str({'SPEED':MIN_SPD_L}), "3-:7-:3,1:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #45
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "3--,3---=1/8",),
    ("2--,2---=1/8", str({'SPEED':MIN_SPD_L}), "6--:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),
    ("3--,3---=1/8", str({'SPEED':MIN_SPD_L}), "7--:5-:2,7-:5-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #49
    ("4--,4---", str({'SPEED':MIN_SPD_L}), "0=5/8"),
    ("4-,1-,6--:4-,1-,6--:0=1/8", "0=3/8"),
    ("5-,3-,1-=1/8", "0:5-,2-,7--=1/4", "5--,5---=1/8"),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #53
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "3--,3---=1/8",),
    ("2--,2---=1/8", str({'SPEED':MIN_SPD_L}), "6--:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),
    ("3--,3---=1/8", str({'SPEED':MIN_SPD_L}), "7--:5-:2,7-:5-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("6--,6---=1/8", str({'SPEED':MIN_SPD_L}), "3-:7-:3,1:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),

    #57
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "3-=1/8",),
    ("6--,6---=1/8", str({'SPEED':MIN_SPD_L}), "3-:7-:3,1:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #61
    ("1-,1--=1/8", str({'SPEED':MIN_SPD_L}), "1-:3-:7-,5-:3-=1/8", str({'SPEED':MAX_SPD_L}), "3--,3---=1/8",),
    ("2--,2---=1/8", str({'SPEED':MIN_SPD_L}), "6--:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),
    ("3--,3---=1/8", str({'SPEED':MIN_SPD_L}), "7--:5-:2,7-:5-=1/8", str({'SPEED':MAX_SPD_L}), "5--,5---=1/8",),
    ("4--,4---=1/8", str({'SPEED':MIN_SPD_L}), "1-:4-:1,6-:4-=1/8", str({'SPEED':MAX_SPD_L}), "4--,4---=1/8",),

    #65
    ("4--,4---=1/2", "0=1/4"),
    ("6--:3-:7-:3,1:3-=1/8", "7-=1/2"),
    ("0=1/4", "5--=1/8"),
    ("4--:1-:5-=1/8", "3,1=3/8"),

    #69
    ("6-=3/8", "0=1/4", "3--=1/8"),
    ("2--:6--:4-:4,1=1/8", "0=1/4"),
    ("{'BEAT':87}",),
    ("3--:7--:5-=1/8", "0=3/8"),
    ("4--:1-:5-:6-:1:0=1/8"),

    #73
    ("0=3/4",),
    ("6---=1/2", "0=1/4"),


)


import sys
sys.path.append('../../src')
if __name__ == "__main__":
    import piano.music_translate as music_translate
    music_parse = music_translate.music_trans([music_table1, music_table2], beat = 96)
    music_parse.music_to_play_table()
    music_parse.play_music()